package com.cloud.mall.test.controller;

import com.cloud.mall.result.GeneralResponse;
import com.cloud.mall.test.service.StorageTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 梁二东
 * @Date: 2024/12/16 10:37
 * @Description:
 **/
@RestController
@RequestMapping("/teststorage")
public class StorageTblController {

    @Autowired
    private StorageTblService storageTblService;

    /**
     * 扣除存储数量
     */
    @GetMapping("/deduct")
    public GeneralResponse<Void> deduct(@RequestParam("commodityCode") String commodityCode, @RequestParam("count") int count) {
        storageTblService.deduct(commodityCode, count);
        return GeneralResponse.success(null);
    }
}
